package com.bjsxt.array;

public class Test2 {

    public static void main(String[] args) {
        Man[] mans = {new Man(10,"dds"),new Man(20,"ddrs"),new Man(30,"d9ds"),new Man(40,"d;ds")};

        for (Man man:mans){
            System.out.println(man.getId());
        }

    }
}
class Man{
    private int id;
    private String name;
    public Man(){}

    public Man(int id, String name) {
        this.id=id;
        this.name=name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}